package org.tong.jaxb.bean;

import lombok.Data;
import lombok.ToString;
import org.tong.jaxb.bean.adapters.DateAdap;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.Date;
import java.util.List;

/**
 * @author
 * @date 2022-08-01 9:38
 */

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@Data
@ToString
public class Tree {

    @XmlElement
    private Integer id;

    @XmlElement
    private String name;

    @XmlAttribute
    private String code;

    @XmlElement
    @XmlJavaTypeAdapter(DateAdap.class)
    private Date date;

    @XmlElementWrapper
    @XmlElement(name = "tree")
    private List<Tree> childs;

}
